package cn.com.surker.material.entity;

import cn.com.surker.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;

/**
 * <p>
 * 原材价格审核表
 * </p>
 *
 * @author admin
 * @since 2025-01-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class MainMaterialExaminePrice extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @NotNull(message = "标识不能为空！", groups = {UpdateStatusGroup.class, UpdateGroup.class})
    private Long id;

    /**
     * 公司ID
     */
    @NotNull(message = "公司标识不能为空！", groups = {AddGroup.class, UpdateGroup.class})
    private Long orgId;

    /**
     * 公司
     */
    private String orgName;

    /**
     * 供应商ID
     */
    @NotNull(message = "公司标识不能为空！", groups = {AddGroup.class, UpdateGroup.class})
    private Long supplierId;

    /**
     * 供应商
     */
    private String supplier;

    /**
     * 运输供应商ID
     */
    private Long transportId;

    /**
     * 运输供应商
     */
    private String transport;

    /**
     * 结算时间
     */
    @NotNull(message = "公司标识不能为空！", groups = {AddGroup.class, UpdateGroup.class})
    private String today;

    /**
     * 报表开始时间
     */
    private String startTime;

    /**
     * 报表结束时间
     */
    private String endTime;

    /**
     * 材料ID
     */
    @NotNull(message = "公司标识不能为空！", groups = {AddGroup.class, UpdateGroup.class})
    private Long materialId;

    /**
     * 材料名称
     */
    private String material;

    /**
     * 材料生效时间
     */
    @NotNull(message = "公司标识不能为空！", groups = {AddGroup.class, UpdateGroup.class})
    private String takeTime;

    /**
     * 上月单价
     */
    private Double lastPrice;

    /**
     * 上月运输单价(多个写入最高单价)
     */
    private Double lastTransportPrice;

    /**
     * 是否自动(0:自动1:手动)
     */
    private Integer isAuto;

    /**
     * 单价
     */
    private Double price;

    /**
     * 运输单价(多个写入最高单价)
     */
    private Double transportPrice;

    /**
     * 类型(0：主材，1：运输)
     */
    @NotNull(message = "公司标识不能为空！", groups = {AddGroup.class, UpdateGroup.class})
    private Integer type;

    /**
     * 是否审核(0:未审核1:已审核)
     */
    private Integer isCheck;

    /**
     * 审核人
     */
    private String checker;

    /**
     * 审核时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date checkTime;
    private Integer isFinance;

    /**
     * 审核人
     */
    private String finance;

    /**
     * 审核时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date financeTime;
    /**
     * 联系人
     */
    private String linkMan;

    /**
     * 调价备注
     */
    private String priceRemark;

    @TableField(exist = false)
    private Integer isCloud;

    public MainMaterialExaminePrice(){}
    public MainMaterialExaminePrice(Long orgId, String orgName, Long supplierId, String supplier, Long transportId,
                                    String transport, String today, String startTime, String endTime, Long materialId,
                                    String material, String takeTime, Double lastPrice, Double lastTransportPrice,
                                    Double price, Double transportPrice, Integer type, Integer isCheck, String priceRemark) {
        this.orgId = orgId;
        this.orgName = orgName;
        this.supplierId = supplierId;
        this.supplier = supplier;
        this.transportId = transportId;
        this.transport = transport;
        this.today = today;
        this.startTime = startTime;
        this.endTime = endTime;
        this.materialId = materialId;
        this.material = material;
        this.takeTime = takeTime;
        this.lastPrice = lastPrice;
        this.lastTransportPrice = lastTransportPrice;
        this.price = price;
        this.transportPrice = transportPrice;
        this.type = type;
        this.isCheck = isCheck;
        this.priceRemark = priceRemark;
    }
}
